from browser import ajax
from browser import window

def checkUser(req):
    print(req.status , req.text)
    if req.status == 401:
        window.location.href = "./index.html"
        # print("error")

request = ajax.Ajax()
request.bind("complete", checkUser)
request.open("GET", "/check", False)
request.send()